package com.td.core.obj.utils;

import com.td.core.obj.TDMap;
import com.td.core.obj.TDPoint;
import com.td.core.pathfinding.PathPoint;

public class PointConverter {

	public static TDVector toTDVector(TDPoint tdPoint) {
		
		return new TDVector(tdPoint.getX() * 
				TDMap.DrawParams.FIELD_SIZE, tdPoint.getY() * 
				TDMap.DrawParams.FIELD_SIZE);
	}
	
	public static TDPoint toTDPoint(TDVector tdVector) {
		
		return new TDPoint((int)(tdVector.getX() / TDMap.DrawParams.FIELD_SIZE), 
				(int)( tdVector.getY() / TDMap.DrawParams.FIELD_SIZE));
	}
	
	public static PathPoint toPathPoint (TDPoint tdPoint) {
		
		return new PathPoint(tdPoint.getX(), tdPoint.getY());
	}
	
	public static TDPoint toTDPoint (PathPoint pathPoint) {
		
		return new TDPoint(pathPoint.getX(), pathPoint.getY());
	}
	
}
